<?php

namespace app\adm\controller;

use app\base\BaseController;
use app\load\loadServices\AdminServices;
use think\Exception;

/**
 * 岗位管理
 */
class Position extends BaseController
{


    /**
     * 列表
     * @return mixed
     */
    public function list()
    {
        $input = input();
        try {
            $where['status'] = 1;
            $where['id'] = ['>', 1];
            if (!empty($input['keyword'])) {
                $where['name'] = ['like', '%' . $input['keyword'] . '%'];
            }
            $result = AdminServices::Position()->list($where, 'id,title as name');
            return to_assign(0, '', $result);
        } catch (Exception $e) {
            return to_assign(1, $e->getMessage());
        }
    }
}